<?php
include("utils.php");
if($_POST['mode']=="save")
{
	save();
}
else
{
	main_content("main();");
}

function main()
{

if($_SESSION['languageId']!="")
{
	$languageId=$_SESSION['languageId'];
}
else
{
	$languageId='1';
}

?>
<table width="90%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td valign="top" align="center"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td valign="top"><?php //include("left_pannel.php"); ?></td>
                    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td width="11"><img src="images/PinkBorderTopLeft.jpg" alt="" width="11" height="11"></td>
                              <td class="PinkBoxTopBg"><img src="images/spacer.gif" alt="" width="10" height="11"></td>
                              <td width="11"><img src="images/PinkBorderTopRight.jpg" alt="" width="11" height="11"></td>
                            </tr>
                        </table></td>
                      </tr>
                      <tr>
                        <td class="PinkTwosideBorder" valign="top"><table width="100%" class="center" cellspacing="0" cellpadding="0">
    <tr>
    <td align="left" valign="top">

<!-- start middle table -->

<table width="100%" class="center" cellspacing="0" cellpadding="0">
  <tbody>

  <tr>
    <td>

     <body id="tab3">
				<ul id="tabnav">
				<li class="tab1"><a href="#">Build Layout</a></li>
				<li class="tab2"><a href="#">Add Details</a></li>
				<li class="tab3"><a href="#">Get Code</a></li>
				</ul>
				</body>

    </td>
  </tr>
  <tr>
    <td style="padding-top: 20px;padding-bottom:10px;" class="font-11 latest_heading2" align="left">
      <strong>
Please check below in the Ad Space Code section for the code snippet that you will need to place on your website. The placement of the 2in1Ads snippet in your html code depends on where you want the ads to run. Once the 2in1Ads snippet is placed in the source html files, the Ad Space will be available for purchase.
		</strong>
    </td>
  </tr>
  <tr>
    <td>
    <table cellpadding="3" cellspacing="1">
  <tbody><tr>
    <td style="text-align: left; color: rgb(255, 255, 255); font-weight: bold;" class="blue-background-small">Ad Space Details</td>
  </tr>

<?php
//echo $_SESSION['adspaceId'];
//echo $_SESSION['adspaceId'];
  $sql_details="select * from ".SITEMASTER." as SM ,".ADSPSCEMASTER." AM, ".ADSPACEDETAILS." SD, ".CATEGORIES." CA where SM.adsiteId=AM.adsiteId and AM.langId='".$languageId."' and AM.UserId='".$_SESSION['siteuserId']."' and AM.adspaceId='".$_SESSION['adspaceId']."' and SM.adcategoryId=CA.adcategoryId and AM.adspaceId=SD.adspaceId ";

$query_details=mysql_query($sql_details);
$rec_details=mysql_fetch_array($query_details);
?>
  <tr style="background-color: rgb(251, 251, 251);">
    <td>
      <div style="padding: 3px; text-align: left;">
      <table style="width: 100%; text-align: left;">
        <tbody><tr>
          <td>Website:</td>
          <td><?php echo $rec_details['adSiteName'];?></td>
        </tr>

        <tr>
          <td>Ad Space Name:</td>
          <td><?php echo $rec_details['adSpaceName'];?></td>
        </tr>
        <tr>
          <td>Ad Space Type:</td>
          <td><?php echo $rec_details['adspaceType'];?></td>

        </tr>
        <tr>
          <td>Category:</td>
          <td title="<?php echo $rec_details['categoryName'];?>"><?php echo $rec_details['categoryName'];?></td>
        </tr>
        <tr>
          <td>Ad Space Start Date:</td>

          <td><?php echo $rec_details['readyDate'];?></td>
        </tr>
              </tbody></table>
          </div>
    </td>
  </tr>
</tbody></table>
    </td>
  </tr>

  <tr>
    <td style="padding-top: 10px;" colspan="2" align="center">

<table style="background-color: rgb(153, 153, 153); width: 95%;" cellpadding="3" cellspacing="1" align="center">
  <tbody><tr>
    <td style="text-align: left; color: rgb(255, 255, 255); font-weight: bold;" class="blue-background-small">Ad Space Code</td>
  </tr>
  <tr style="background-color: rgb(251, 251, 251);">

    <td>
      <div style="padding: 3px; text-align: left;">
<div style="margin: 3px 0px; text-align: left;">
  <div style="float: right;">
    <span id="copy" style="text-align: right; height: 100%; visibility: hidden;">
      <a href="javascript: copyToClipboard(document.getElementById('bannerCode'));"><img src="themes/images/icon-clipboard.gif" alt="Copy To Clipboard">Copy To Clipboard</a>
    </span>
      </div>
  
  
  <div style="clear: both;" align="center">
    <div id="bannerCode" style="border: 1px solid rgb(51, 51, 102); background-color: rgb(204, 204, 204); color: rgb(51, 51, 51); width: 98%; text-align: left;">
<!--&lt;?php<br />
      $val="<?php echo md5($_SESSION['adspaceId']);?>" ;<br />
      $authnet_values                = array<br />
(<br />
&quot;id&quot;                =&gt; &quot;$val&quot;, <br />
);<br />
$fields = &quot;&quot;; <br />
foreach( $authnet_values as $key =&gt; $value ) $fields .= &quot;$key=&quot; . urlencode( $value ) . &quot;&amp;&quot;;<br />
$ch = curl_init(&quot;<?php echo $GLOBALS['site_url'];?><?php if($_SESSION['adspace_type'] == 'text' ) {?>Delivery/23846PG.php<?php } ?><?php if($_SESSION['adspace_type'] == 'banner' ) {?>Delivery/show_banner.php<?php } ?><?php if($_SESSION['adspace_type'] == 'thumbnail' ) {?>Delivery/show_thumbnail.php <?php } ?> &quot;); <br />
curl_setopt($ch, CURLOPT_HEADER, 0);<br />
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);<br />
curl_setopt($ch, CURLOPT_POSTFIELDS, rtrim( $fields, &quot;&amp; &quot; ));<br />
echo $resp = curl_exec($ch);<br />
curl_close ($ch);<br />
?&gt;
-->
<?php 

$code='<script language="javascript" type="text/javascript" charset="utf-8">
ads_val="'.md5($_SESSION['adspaceId']).'";
ad_direc_net= "'.$_SESSION['netVal'].'";
url="'.$GLOBALS['site_url'].'";
</script>
<script language="javascript" type="text/javascript" charset="utf-8" src="'.$GLOBALS["site_url"].'/Delivery/js/43569278.js"></script>';
echo htmlentities($code);
?>
</div>

  </div>
    <div style="text-align: center;">
    <!--<input id="preview" name="preview" value="Preview" class="blank-button-middle" onclick="javascript:window.open('selling-adspace-preview.php?sid=698f061bd71550c6b3e89e269eeebc68&space_id=74627&view='+param_view, '_blank', 'height=500,width=600,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes');" type="button">
    <input id="editButtonId" name="edit_button" value="Edit" style="margin-left: 5px;" class="blank-button-small" onclick="javascript: window.location.href='selling-adspace-details.php?sid=698f061bd71550c6b3e89e269eeebc68&space_id=' + 74627" type="button">-->
    <input id="doneButtonId" name="done_button" value="Done" style="margin-top: 8px; margin-left: 5px;" class="yellow-button-small" onClick="javascript: window.location.href='all_adspaces.php?tab=sell_ads&subMenu=4'" type="button">
  </div>
</div>
      </div>
    </td>

  </tr>
</tbody></table>

<script language="javascript" type="text/javascript">

/**
 * Copys the content to clipboard.
 */
function copyToClipboard(textarea) {
    window.clipboardData.setData('Text', textarea.innerText);
}

</script></td>
  </tr>
</tbody></table>

<!-- end middle table -->

</td>
</tr>

</table></td>
                      </tr>
                      <tr>
                        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td width="11"><img src="images/PinkBorderBottomLeft.jpg" alt="" width="11" height="11"></td>
                              <td class="PinkBoxBottomBg"><img src="images/spacer.gif" alt="" width="10" height="11"></td>
                              <td width="11"><img src="images/PinkBorderBottomRight.jpg" alt="" width="11" height="11"></td>
                            </tr>
                        </table></td>
                      </tr>
                    </table></td>
                    <td>&nbsp;</td>
                    </tr>
                </table></td>
              </tr>
            </table>
<?php
}
?>